GXLockShape
You can use the GXLockShape function to load a shape into memory and lock its geometry into a fixed memory location.
void GXLockShape(gxShape target);
target
- A reference to the shape to be loaded and locked.
DESCRIPTION
The GXLockShape function prevents a shape from being relocated. You must set thegxDirectShape
attribute of the target shape before calling this function.To avoid fragmenting the QuickDraw GX heap, call the GXUnlockShape function as soon as possible after calling
GXLockShape
.To directly edit a shape's geometry, call
GXLockShape
followed byGXGetShapeStructure
. After editing, callGXUnlockShape
followed byGXChangedShape
.SPECIAL CONSIDERATIONS
TheGXLockShape
function is not related to thegxLockedShape
shape attribute. If you set thegxLockedShape
attribute, you cannot alter the shape's geometry with functions such asGXSetPoint
andGXSetRectangle
, described in the geometric shapes chapter of Inside Macintosh: QuickDraw GX Graphics. SettinggxLockedShape
has no effect on the direct manipulation of geometry using the calls described here.In low memory conditions with fragmented memory, QuickDraw GX can unlock locked objects and relocate them. Be careful about making memory-intensive calls after locking an object.
ERRORS, WARNINGS, AND NOTICES
Errors out_of_memory shape_is_nil graphic_type_does_not_have_a_structure (debugging version) Notices (debugging version) directShape_attribute_set_as_side_effect SEE ALSO
TheGXUnlockShape
,GXGetShapeStructure
, andGXChangedShape
functions are described in the following three sections.Shape attributes are described in the section "Shape Attributes" beginning on page 2-16. To set shape attributes, use the
GXSetShapeAttributes
function, described on page 2-74.